﻿using l1cs.server.model.Instance;
using System;

namespace l1cs.server.model.classes
{
    public abstract class L1ClassFeature
    {
        public static L1ClassFeature newClassFeature( int classId )
        {
            if ( classId == L1PcInstance.CLASSID_PRINCE
                    || classId == L1PcInstance.CLASSID_PRINCESS )
            {
                return new L1RoyalClassFeature();
            }
            if ( classId == L1PcInstance.CLASSID_ELF_MALE
                    || classId == L1PcInstance.CLASSID_ELF_FEMALE )
            {
                return new L1ElfClassFeature();
            }
            if ( classId == L1PcInstance.CLASSID_KNIGHT_MALE
                    || classId == L1PcInstance.CLASSID_KNIGHT_FEMALE )
            {
                return new L1KnightClassFeature();
            }
            if ( classId == L1PcInstance.CLASSID_WIZARD_MALE
                    || classId == L1PcInstance.CLASSID_WIZARD_FEMALE )
            {
                return new L1WizardClassFeature();
            }
            if ( classId == L1PcInstance.CLASSID_DARK_ELF_MALE
                    || classId == L1PcInstance.CLASSID_DARK_ELF_FEMALE )
            {
                return new L1DarkElfClassFeature();
            }
            if ( classId == L1PcInstance.CLASSID_DRAGON_KNIGHT_MALE
                    || classId == L1PcInstance.CLASSID_DRAGON_KNIGHT_FEMALE )
            {
                return new L1DragonKnightClassFeature();
            }
            if ( classId == L1PcInstance.CLASSID_ILLUSIONIST_MALE
                    || classId == L1PcInstance.CLASSID_ILLUSIONIST_FEMALE )
            {
                return new L1IllusionistClassFeature();
            }
            return null;
        }

        public abstract int getAcDefenseMax( int ac );

        public abstract int getMagicLevel( int playerLevel );
    }
}